<?php
require 'db.php';

$strsql = "select * from student left join major on student.major = major.Id";
$current_order = "";
if (isset($_GET['order'])){
    $current_order = $_GET['order'];
    $strsql .= " order by student.num ".$current_order;
}
echo $strsql;
echo "<br>";
$next_order = ($current_order=="desc") ? "asc" : "desc";//其中一种

$result = mysqli_query($link, $strsql);
$data = mysqli_fetch_all($result);

mysqli_free_result($result);
mysqli_close($link);



require 'paixu.html';
require 'showdata.html';

?>